home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
try_qb
/
check.bas
(
.txt
)
< prev
next >
Wrap
QuickBASIC Tokenized Source
|
1989-12-04
|
2KB
|
28 lines
Amount
FALSE
Balance
TransacNum
Limit
Swaps
Get account's starting balance:
Type starting balance, then press <ENTER>: "
Get transactions. Continue accepting input until the
input is zero for a transaction, or until 100
transactions have been entered:
) Enter transaction amount (0 to end): "
Sort transactions in ascending order,
using a "bubble sort":s
If two adjacent elements are out of order, switch
those elements:
Sort on next pass only to where the last switch was made:
Sort until no elements are exchanged:
Print the sorted transaction array. If a transactionm
is greater than zero, print it as a "CREDIT"; if ao
transaction is less than zero, print it as a "DEBIT":
CREDIT: $$#####.##
DEBIT: $$#####.##
Update balance:
Print the final balance:
--------------------------
Final Total: $$######.##